package com.codeoss.framework.webide.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.codeoss.framework.webide.response.WebIDEResponse;
import com.codeoss.framework.webide.service.IWebIDEService;

@Controller
@RequestMapping("webide")
public class WebIDEController {
	@Autowired
	private IWebIDEService webIDE2Service;
	
	@RequestMapping(value = "init", method = RequestMethod.GET)
	@ResponseBody
	public WebIDEResponse init(){
		WebIDEResponse webIDE2Response=webIDE2Service.init();
		return webIDE2Response;
	}
	
	@RequestMapping(value = "getRecentModelList", method = RequestMethod.GET)
	@ResponseBody
	public WebIDEResponse getRecentModelList(){
		WebIDEResponse webIDE2Response=webIDE2Service.getRecentModelList();
		return webIDE2Response;
	}
	
	@RequestMapping(value = "getRecentPageList", method = RequestMethod.GET)
	@ResponseBody
	public WebIDEResponse getRecentPageList(){
		WebIDEResponse webIDE2Response=webIDE2Service.getRecentPageList();
		return webIDE2Response;
	}
	
	@RequestMapping(value = "getRecentReportList", method = RequestMethod.GET)
	@ResponseBody
	public WebIDEResponse getRecentReportList(){
		WebIDEResponse webIDE2Response=webIDE2Service.getRecentReportList();
		return webIDE2Response;
	}
	
	@RequestMapping(value = "getRecentWorkflowList", method = RequestMethod.GET)
	@ResponseBody
	public WebIDEResponse getRecentWorkflowList(){
		WebIDEResponse webIDE2Response=webIDE2Service.getRecentWorkflowList();
		return webIDE2Response;
	}
	
	@RequestMapping(value = "getRecentApplicationList", method = RequestMethod.GET)
	@ResponseBody
	public WebIDEResponse getRecentApplicationList(){
		WebIDEResponse webIDE2Response=webIDE2Service.getRecentApplicationList();
		return webIDE2Response;
	}
	
	@RequestMapping(value = "getPageCodeByMenuCode", method = RequestMethod.GET)
	@ResponseBody
	public WebIDEResponse getPageCodeByMenuCode(@RequestParam("menuCode") String menuCode){
		WebIDEResponse webIDE2Response=webIDE2Service.getPageCodeByMenuCode(menuCode);
		return webIDE2Response;
	}
}
